<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<script type="text/javascript">

	/**查找带回机构信息*/
	function lookUpNetsite() {
		$.pdialog.open('netsiteLookUp', 'organization', '网点信息', {
			width : 1000,
			height : 580,
			mask : true
		});
	}
	
	function sendCommentToCourier() {

		var list=document.getElementsByName("c1");
		var mobileList=new Array();
		var mobileNum=0;
		var len=list.length;
		var num = 0;
	    var listItem;
	    for(var i = 0; i < len; i++) {
	        listItem = list[i];  
	        if(listItem.checked) {
	            num++;
	           mobileList[mobileNum]=listItem.value;
	           mobileNum++;
	        }
	    }
	    if(num<=0)
	    {
	    	alert('至少选择一名 快递员');
	    }else
	    {
	    	navTab.openTab('123', '/Skuaiditu-managerCms/courierFunctionAction.action?toResult=sendSMSToCourier&rightId=${rightId}', { title:"发送短信", fresh:false, data:{mobileList:mobileList.toString()} });
	    }
		   	
	}
		
</script>
<c:if test="${code==1}">	 
	<form onsubmit="return navTabSearch(this);" action="courierFunctionAction.action?toResult=searchCourierFunction&rightId=${rightId}" method="post">
		<div class="pageHeader">
			<input type="hidden" name="init" value=0>
			<div class="searchBar">
				<table class="searchContent">
					<tr>		
						<td>快递网点：</td>
							<td width=""><a class="btnLook"
									href="javascript:void(0);" onclick="lookUpNetsite()">									
									查找带回</a><input id="searchCompany_netsiteName" type="text" name="netSiteName"
									 bringBackName="netSiteName" value="${netSiteName}" readonly="readonly" size="30" />
									 <input type="hidden"
									name="netSiteId"  bringBackName="netSiteId" value="${netSiteId}" /></td>			
						<td>真实姓名: <input id="realname" type="text" name="realname" value="${realname}" />
						</td>						
						<td>
							<div class="buttonActive">
								<div class="buttonContent">
									<button type="submit">检索</button>
								</div>
							</div>
						</td>
					</tr>
			
				</table>

		</div>
		<div class="pageContent">
			<div class="panelBar">
				<ul class="toolBar">
				<li><button type="button" onclick="sendCommentToCourier()">发送短消息</button></li>		
				</ul>
			</div>
			<table class="list" width="100%" layoutH="108">
				<thead>
					<tr>
						<th align="center"><input type="checkbox" class="checkboxCtrl" group="c1"/></th>
						<th align="center">用户名</th>
						<th align="center">状态</th>
						<th align="center">电话</th>
						<th align="center">真实姓名</th> 
						<th align="center">性别</th>
						<th align="center">所属网点</th>
						<th align="center">评分等级</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator var="courier" value="page.data" status="st">
						<tr target="sid_support" rel="<s:property value="#courier.id" />">
							<th width="1%" align="center">
							<input type="checkbox" name="c1" value="<s:property value="#courier.mobile" />" />
							</th>
							<th width="3%" align="left"><s:property value="#courier.username" />
							</th>
							<th width="5%" align="left">
								<s:if test="#courier.locked ==0"><span style="color:blue">启用</span></s:if> 
								<s:elseif test="#courier.locked ==1"><span style="color:gray">禁用</span></s:elseif>
							</th>
							<th width="5%" align="left"><s:property value="#courier.mobile" />
							</th>
							<th width="5%" align="left"><s:property value="#courier.realname" />
							</th> 
							<th width="5%" align="left">
								<s:if test="#courier.gender ==0">女</s:if> 
								<s:elseif test="#courier.gender ==1">男</s:elseif>
							</th>
							<th width="7%" align="left"><s:property value="#courier.netSiteName" />
							</th>
							<th width="5%" align="left"><s:property value="#courier.grade" />
							</th>
						</tr>
					</s:iterator>
				</tbody>
			</table>
			<div class="panelBar">
				<div class="pages">
					<span>共${page.totalNum }条，共${page.totalPage }页</span>
				</div>
				<div class="pagination" targetType="navTab" totalCount="${page.totalNum }" numPerPage="${page.pageSize }" pageNumShown="10" currentPage="${page.currentPage }"></div>
			</div>
		</div>
	</form>
</c:if>
<c:if test="${code==0}">
	${message}
</c:if>